package com.xxl.job.executor.service.impl;

import com.xxl.job.core.log.XxlJobLogger;
import com.xxl.job.executor.common.util.ConfigProperties;
import com.xxl.job.executor.common.util.DBUtils;
import com.xxl.job.executor.common.util.SpringContextHolder;
import com.xxl.job.executor.service.IOutListService;
import org.springframework.jdbc.datasource.DataSourceUtils;
import org.springframework.stereotype.Service;

import javax.sql.DataSource;
import java.sql.Connection;

@Service("OutListService")
public class OutListService implements IOutListService {
    @Override
    public void syncData() throws Exception {
        try{
            //同步MTC出口交易流水

            this.syncMtcExList();

            //同步ETC出口交易流水
            this.syncEtcExList();

            //同步ETC刷卡交易流水
            //this.syncEtcExtu();
        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }
    }

    /**
     * 同步MTC出口流水
     * @throws Exception
     */
    public void syncMtcExList() throws Exception {
        DataSource dataSourcePre = SpringContextHolder.getBean("dataSourcePre");
        Connection connPre = DataSourceUtils.getConnection(dataSourcePre);
        XxlJobLogger.log("=====开始执行[同步MTC出口流水]业务操作===");
        final String recordName = "boutlist";
        try {
            connPre.setAutoCommit(false);//设置自动提交为false，用于控制事务

            String recordStr = DBUtils.getCurSynRecordNum(connPre, recordName);
            XxlJobLogger.log("[普通]本次同步起始时间:" + recordStr);

            String dbCurTime = DBUtils.getDBCurTime(connPre);
            XxlJobLogger.log("[普通]本次同步截止时间为:" + dbCurTime);

            StringBuffer sql = new StringBuffer();
            sql.append("insert into TB_SYNC_TRC_OTU_TMP(id,tollprovinceid,mediatype,mediano,exitfeetype,transpaytype,obusign,identification,cardid,etccardtype,extime,vehicleid,vehicletype,vehicleclass," +
                    "entolllaneid,entolllanehex,entime,entollstationname,extollstationname,extolllaneid,passid,vehiclesign,payfee,fee,discountfee,discounttype," +
                    "provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname,islocal,transferstatus,receivetime,transferstatus_bzx,receivetime_bzx," +
                    "transferstatus_split,transferstatus_inv,recordid,inserttime,updatetime,batchno,domain1,domain2,domain3,domain4,laneNo,vehnum,elepaymethod) " +
                    "select ListNo as id,tollprovinceid,mediatype,cardNo as mediano,exitfeetype,payType as transpaytype,obusign,identification,cardid,EleCardType as etccardtype,replace(to_char(OpTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') extime,VehPlate,vehtype,vehclass," +
                    "entolllaneid,entolllanehex,replace(to_char(InOpTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') entime,entollstationname,extollstationname,extolllaneid,passid,vehiclesign,PTotalToll payfee," +
                    "TotalToll as fee,discount as discountfee,discounttype," +
                    "provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname,multiProvince islocal,1 transferstatus,null receivetime,0 transferstatus_bzx,null receivetime_bzx," +
                    "0 transferstatus_split,0 transferstatus_inv,SEQ_TB_SYNC_TRC_OTU.nextval recordid,sysdate inserttime,sysdate updatetime,null as batchno," +
                    " null as domain1,null as domain2,null as domain3,null as domain4,laneno,vehnum,elepaymethod " +
                    " from BOutList_ALL where 1=1" +
                    " and inserttabletime>=to_date('" + recordStr + "','yyyy-mm-dd hh24:mi:ss') and inserttabletime<to_date('" + dbCurTime + "','yyyy-mm-dd hh24:mi:ss') ");
            Integer count = DBUtils.execute(connPre, sql.toString());
            XxlJobLogger.log("[普通]本次从省汇聚同步(条):" + count);

            StringBuffer sql2 = new StringBuffer();
            sql2.append("insert into TB_SYNC_TRC_OTU(LANENO,RECEIVETIME_BZX,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                    "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4,ID,TOLLPROVINCEID,MEDIATYPE,MEDIANO,EXITFEETYPE,TRANSPAYTYPE,OBUSIGN," +
                    "IDENTIFICATION,CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,ENTOLLLANEID,ENTOLLLANEHEX,ENTIME," +
                    "ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEID,PASSID,VEHICLESIGN,PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE," +
                    "PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL,TRANSFERSTATUS,RECEIVETIME," +
                    "TRANSFERSTATUS_BZX,vehnum,elepaymethod) " +
                    "select LANENO,RECEIVETIME_BZX,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                    "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4,ID,TOLLPROVINCEID,MEDIATYPE,MEDIANO,EXITFEETYPE,TRANSPAYTYPE,OBUSIGN," +
                    "IDENTIFICATION,CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,ENTOLLLANEID,ENTOLLLANEHEX,ENTIME," +
                    "ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEID,PASSID,VEHICLESIGN,PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE," +
                    "PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL,TRANSFERSTATUS,RECEIVETIME," +
                    "TRANSFERSTATUS_BZX,vehnum,elepaymethod "+
                    "from TB_SYNC_TRC_OTU_TMP");
            DBUtils.execute(connPre, sql2.toString());

            count = DBUtils.modifySynRecordNum(connPre, recordName, recordStr, dbCurTime);
            if (count == null || count != 1) {
                XxlJobLogger.log("[异常][普通]更新记录时间异常");
                throw new Exception("[普通]更新记录时间异常");
            }
            XxlJobLogger.log("[普通]更新记录时间为:" + dbCurTime);

            //统计MTC出口车流量及通行费
            statisMtcExCarFlowAndFee(connPre);

            connPre.commit();
            XxlJobLogger.log("=====完成执行[同步MTC出口流水]业务操作===");
        }catch(Exception e){
            if (connPre != null) {
                try {
                    connPre.rollback();
                    XxlJobLogger.log("回滚成功.");
                }catch (Exception e1){
                    e1.printStackTrace();
                }
            }
            XxlJobLogger.log("抛出异常："+e.getMessage());
            throw e;
        }finally{
            if (connPre != null) {
                try {
                    connPre.setAutoCommit(true);
                    connPre.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }

    /**
     * 同步ETC出口流水
     * @throws Exception
     */
    public void syncEtcExList() throws Exception {
        DataSource dataSourcePre = SpringContextHolder.getBean("dataSourcePre");
        Connection connPre = DataSourceUtils.getConnection(dataSourcePre);

        XxlJobLogger.log("=====开始执行[同步ETC出口流水]业务操作===");
        final String recordName = "etcboutlist_etc";
        try {
            connPre.setAutoCommit(false);//设置自动提交为false，用于控制事务

            ConfigProperties configProperties = SpringContextHolder.getBean("configProperties");
            String areaNo = configProperties.getAreaNo();

            String recordStr = DBUtils.getCurSynRecordNum(connPre, recordName);
            XxlJobLogger.log("[普通]本次最大记录RECORDID为:" + recordStr);

            String dbCurTime = DBUtils.getDBCurTime(connPre);
            XxlJobLogger.log("[普通]本次同步截止时间为:" + dbCurTime);

            StringBuffer sql = new StringBuffer();
            sql.append("insert into TB_SYNC_TRC_EXETCPU_TMP(id,mediatype,mediano,transpaytype,exitfeetype,obusign,identification,terminaltransno,cardid,etccardtype,extime,vehicleid," +
                    "vehicletype,vehicleclass,tac,transfee,transtype,terminalno,prebalance,postbalance,entolllaneid,entolllanehex,entime,entollstationname,extollstationname," +
                    "extolllanehex,extolllaneid,passid,vehiclesign,payfee,fee,discountfee,discounttype,provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname," +
                    "islocal,transferstatus,receivetime,transferstatus_kf,receivetime_kf,transferstatus_split,transferstatus_inv,recordid,inserttime,updatetime,batchno" +
                    ",vehnum,elepaymethod) " +
                    " select ListNo id,mediatype,CardNo mediano,DataType transpaytype,exitfeetype,obusign,identification,ElePsamTradeNo terminaltransno," +
                    "EleCardNo cardid,EleCardType etccardtype,replace(to_char(opTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') extime,VehPlate vehicleid,VehType vehicletype,VehClass vehicleclass,EleTac tac,transfee,transtype,EleTermID terminalno,EleBBalance prebalance," +
                    "EleABalance postbalance,entolllaneid,entolllanehex,replace(to_char(InOpTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') as entime,entollstationname,extollstationname,null extolllanehex,laneNo extolllaneid," +
                    "passid,vehiclesign,PTotalToll as payfee,TotalToll as fee,discount as discountfee,discounttype,provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname," +
                    "(case when substr(EleCardNo,1,4)='").append(areaNo).append("' and provinceCount=1 then 0 else provinceCount end) as islocal,1 transferstatus," +
                    "null receivetime,0 transferstatus_kf,null receivetime_kf,0 transferstatus_split,0 transferstatus_inv," +
                    "SEQ_TB_SYNC_TRC_ETCEXTU.nextval recordid,sysdate inserttime,sysdate updatetime,null batchno" +
                    ",vehnum,elepaymethod " +
                    " from ETCBOutList_ALL " +
                    " where 1=1" +
                    " and inserttabletime>=to_date('" + recordStr + "','yyyy-mm-dd hh24:mi:ss') and inserttabletime<to_date('" + dbCurTime + "','yyyy-mm-dd hh24:mi:ss') ");
            Integer count = DBUtils.execute(connPre, sql.toString());
            XxlJobLogger.log("[普通]本次从中台系统共同步(条):" + count);

            StringBuffer sql2 = new StringBuffer();
            sql2.append("insert into TB_SYNC_TRC_EXETCPU(ID,MEDIATYPE,MEDIANO,TRANSPAYTYPE,EXITFEETYPE,OBUSIGN,IDENTIFICATION,TERMINALTRANSNO," +
                    "CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,TAC,TRANSFEE,TRANSTYPE,TERMINALNO,PREBALANCE,POSTBALANCE," +
                    "ENTOLLLANEID,ENTOLLLANEHEX,ENTIME,ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEHEX,EXTOLLLANEID,PASSID,VEHICLESIGN," +
                    "PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE,PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL," +
                    "TRANSFERSTATUS,RECEIVETIME,TRANSFERSTATUS_KF,RECEIVETIME_KF,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                    "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4,vehnum,elepaymethod) " +
                    "select ID,MEDIATYPE,MEDIANO,TRANSPAYTYPE,EXITFEETYPE,OBUSIGN,IDENTIFICATION,TERMINALTRANSNO," +
                    "CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,TAC,TRANSFEE,TRANSTYPE,TERMINALNO,PREBALANCE,POSTBALANCE," +
                    "ENTOLLLANEID,ENTOLLLANEHEX,ENTIME,ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEHEX,EXTOLLLANEID,PASSID,VEHICLESIGN," +
                    "PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE,PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL," +
                    "TRANSFERSTATUS,RECEIVETIME,TRANSFERSTATUS_KF,RECEIVETIME_KF,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                    "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4,vehnum,elepaymethod " +
                    " from TB_SYNC_TRC_EXETCPU_TMP");
            DBUtils.execute(connPre, sql2.toString());

            count = DBUtils.modifySynRecordNum(connPre, recordName, recordStr, dbCurTime);
            if (count == null || count != 1) {
                XxlJobLogger.log("[异常][普通]更新记录时间异常");
                throw new Exception("[普通]更新记录时间异常");
            }
            XxlJobLogger.log("[普通]更新记录时间为:" + dbCurTime);

            //统计ETC出口车流量及通行费
            statisEtcExCarFlowAndFee(connPre);

            connPre.commit();
            XxlJobLogger.log("=====完成执行[同步ETC出口流水]业务操作===");
        }catch(Exception e){
            if (connPre != null) {
                try {
                    connPre.rollback();
                    XxlJobLogger.log("回滚成功.");
                }catch (Exception e1){
                    e1.printStackTrace();
                }
            }
            XxlJobLogger.log("抛出异常："+e.getMessage());
            throw e;
        }finally{
            if (connPre != null) {
                try {
                    connPre.setAutoCommit(true);
                    connPre.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }

    /**
     * 同步ETC刷卡交易流水
     * @throws Exception
     */
    public void syncEtcExtu() throws Exception {
        DataSource dataSourcePre = SpringContextHolder.getBean("dataSourcePre");
        Connection connPre = DataSourceUtils.getConnection(dataSourcePre);

        XxlJobLogger.log("=====开始执行[同步ETC刷卡交易流水]业务操作===");
        final String recordName = "etcboutlist_extu";
        try {
            connPre.setAutoCommit(false);//设置自动提交为false，用于控制事务

            ConfigProperties configProperties = SpringContextHolder.getBean("configProperties");
            String areaNo = configProperties.getAreaNo();

            String recordStr = DBUtils.getCurSynRecordNum(connPre, recordName);
            XxlJobLogger.log("[普通]本次最大记录RECORDID为:" + recordStr);

            String dbCurTime = DBUtils.getDBCurTime(connPre);
            XxlJobLogger.log("[普通]本次同步截止时间为:" + dbCurTime);

            StringBuffer sql = new StringBuffer();
            sql.append("insert into TB_SYNC_TRC_ETCEXTU_TMP(id,mediatype,mediano,transpaytype,exitfeetype,obusign,identification,terminaltransno,cardid,etccardtype,extime,vehicleid," +
                    "vehicletype,vehicleclass,tac,transfee,transtype,terminalno,prebalance,postbalance,entolllaneid,entolllanehex,entime,entollstationname,extollstationname," +
                    "extolllanehex,extolllaneid,passid,vehiclesign,payfee,fee,discountfee,discounttype,provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname," +
                    "islocal,transferstatus,receivetime,transferstatus_kf,receivetime_kf,transferstatus_split,transferstatus_inv,recordid,inserttime,updatetime,batchno) " +
                    " select ListNo id,mediatype,CardNo mediano,DataType transpaytype,exitfeetype,obusign,identification,ElePsamTradeNo terminaltransno," +
                    " EleCardNo cardid,EleCardType etccardtype,replace(to_char(opTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') extime,VehPlate vehicleid,VehType vehicletype,VehClass vehicleclass,EleTac tac,transfee,transtype,EleTermID terminalno,EleBBalance prebalance," +
                    " EleABalance postbalance,entolllaneid,entolllanehex,replace(to_char(InOpTime,'yyyy-mm-dd hh24:mi:ss'),' ','T') as entime,entollstationname,extollstationname,null extolllanehex,laneNo extolllaneid," +
                    " passid,vehiclesign,PTotalToll as payfee,TotalToll,discount as discountfee,discounttype,provincediscountfee,stationno,squadno,squaddate,operatorno,operatorname," +
                    " (case when substr(EleCardNo,1,4)='").append(areaNo).append("' and provinceCount=1 then 0 else provinceCount end) as islocal,1 transferstatus," +
                    " null receivetime,0 transferstatus_kf,null receivetime_kf,0 transferstatus_split,0 transferstatus_inv," +
                    " SEQ_TB_SYNC_TRC_ETCEXTU.nextval recordid,sysdate inserttime,sysdate updatetime,null batchno " +
                    " from ETCBOutList " +
                    " where datatype=2 and " +
                    " inserttabletime>=to_date('" + recordStr + "','yyyy-mm-dd hh24:mi:ss') and inserttabletime<to_date('" + dbCurTime + "','yyyy-mm-dd hh24:mi:ss') ");
            Integer count = DBUtils.execute(connPre, sql.toString());
            XxlJobLogger.log("[普通]本次从中台系统共同步(条):" + count);

            StringBuffer sql2 = new StringBuffer();
            sql2.append("insert into TB_SYNC_TRC_ETCEXTU(ID,MEDIATYPE,MEDIANO,TRANSPAYTYPE,EXITFEETYPE,OBUSIGN,IDENTIFICATION,TERMINALTRANSNO," +
                    "CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,TAC,TRANSFEE,TRANSTYPE,TERMINALNO,PREBALANCE,POSTBALANCE," +
                    "ENTOLLLANEID,ENTOLLLANEHEX,ENTIME,ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEHEX,EXTOLLLANEID,PASSID,VEHICLESIGN," +
                    "PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE,PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL," +
                    "TRANSFERSTATUS,RECEIVETIME,TRANSFERSTATUS_KF,RECEIVETIME_KF,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                    "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4) " +
                    "select ID,MEDIATYPE,MEDIANO,TRANSPAYTYPE,EXITFEETYPE,OBUSIGN,IDENTIFICATION,TERMINALTRANSNO," +
                            "CARDID,ETCCARDTYPE,EXTIME,VEHICLEID,VEHICLETYPE,VEHICLECLASS,TAC,TRANSFEE,TRANSTYPE,TERMINALNO,PREBALANCE,POSTBALANCE," +
                            "ENTOLLLANEID,ENTOLLLANEHEX,ENTIME,ENTOLLSTATIONNAME,EXTOLLSTATIONNAME,EXTOLLLANEHEX,EXTOLLLANEID,PASSID,VEHICLESIGN," +
                            "PAYFEE,FEE,DISCOUNTFEE,DISCOUNTTYPE,PROVINCEDISCOUNTFEE,STATIONNO,SQUADNO,SQUADDATE,OPERATORNO,OPERATORNAME,ISLOCAL," +
                            "TRANSFERSTATUS,RECEIVETIME,TRANSFERSTATUS_KF,RECEIVETIME_KF,TRANSFERSTATUS_SPLIT,TRANSFERSTATUS_INV,RECORDID,INSERTTIME," +
                            "UPDATETIME,BATCHNO,DOMAIN1,DOMAIN2,DOMAIN3,DOMAIN4 " +
                    "from TB_SYNC_TRC_ETCEXTU_TMP ");
            DBUtils.execute(connPre, sql2.toString());
            XxlJobLogger.log("[普通]本次从中台系统共同步(条):" + count);

            count = DBUtils.modifySynRecordNum(connPre, recordName, recordStr, dbCurTime);
            if (count == null || count != 1) {
                XxlJobLogger.log("[异常][普通]更新记录时间异常");
                throw new Exception("[普通]更新记录时间异常");
            }
            XxlJobLogger.log("[普通]更新记录时间为:" + dbCurTime);

            //统计ETC出口刷卡车流量及通行费
            statisEtcExtuCarFlowAndFee(connPre);

            connPre.commit();
            XxlJobLogger.log("=====完成执行[同步ETC刷卡交易流水]业务操作===");
        }catch(Exception e){
            if (connPre != null) {
                try {
                    connPre.rollback();
                    XxlJobLogger.log("回滚成功.");
                }catch (Exception e1){
                    e1.printStackTrace();
                }
            }
            XxlJobLogger.log("抛出异常："+e.getMessage());
            throw e;
        }finally{
            if (connPre != null) {
                try {
                    connPre.setAutoCommit(true);
                    connPre.close();
                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }
    }

    /**
     * 统计出口MTC车流量及通行费信息
     * @param connPre
     * @throws Exception
     */
    private void statisMtcExCarFlowAndFee(Connection connPre) throws Exception{
        int count = 0;
        try{
            XxlJobLogger.log("[出口流水统计]统计开始");
            //合并临时完整性表到正式表
            String statSql = "MERGE INTO TB_STATIS_STATION_EXTRADE A USING V_SYNC_TRC_OTU B " +
                    "ON (A.TRADE_DATE=B.TRADE_DATE and A.STATION_ID=B.STATION_ID) " +
                    "WHEN MATCHED THEN " +
                    "UPDATE SET A.VEHICLE_FLOW_1=nvl(B.VEHICLE_FLOW_1,0)+nvl(A.VEHICLE_FLOW_1,0)," +
                    "A.VEHICLE_FLOW_2=nvl(B.VEHICLE_FLOW_2,0)+nvl(A.VEHICLE_FLOW_2,0)," +
                    "A.VEHICLE_FLOW_3=nvl(B.VEHICLE_FLOW_3,0)+nvl(A.VEHICLE_FLOW_3,0)," +
                    "A.VEHICLE_FLOW_4=nvl(B.VEHICLE_FLOW_4,0)+nvl(A.VEHICLE_FLOW_4,0)," +
                    "A.VEHICLE_FLOW_11=nvl(B.VEHICLE_FLOW_11,0)+nvl(A.VEHICLE_FLOW_11,0)," +
                    "A.VEHICLE_FLOW_12=nvl(B.VEHICLE_FLOW_12,0)+nvl(A.VEHICLE_FLOW_12,0)," +
                    "A.VEHICLE_FLOW_13=nvl(B.VEHICLE_FLOW_13,0)+nvl(A.VEHICLE_FLOW_13,0)," +
                    "A.VEHICLE_FLOW_14=nvl(B.VEHICLE_FLOW_14,0)+nvl(A.VEHICLE_FLOW_14,0)," +
                    "A.VEHICLE_FLOW_15=nvl(B.VEHICLE_FLOW_15,0)+nvl(A.VEHICLE_FLOW_15,0)," +
                    "A.VEHICLE_FLOW_16=nvl(B.VEHICLE_FLOW_16,0)+nvl(A.VEHICLE_FLOW_16,0)," +
                    "A.VEHICLE_FLOW_21=nvl(B.VEHICLE_FLOW_21,0)+nvl(A.VEHICLE_FLOW_21,0)," +
                    "A.VEHICLE_FLOW_22=nvl(B.VEHICLE_FLOW_22,0)+nvl(A.VEHICLE_FLOW_22,0)," +
                    "A.VEHICLE_FLOW_23=nvl(B.VEHICLE_FLOW_23,0)+nvl(A.VEHICLE_FLOW_23,0)," +
                    "A.VEHICLE_FLOW_24=nvl(B.VEHICLE_FLOW_24,0)+nvl(A.VEHICLE_FLOW_24,0)," +
                    "A.VEHICLE_FLOW_25=nvl(B.VEHICLE_FLOW_25,0)+nvl(A.VEHICLE_FLOW_25,0)," +
                    "A.VEHICLE_FLOW_26=nvl(B.VEHICLE_FLOW_26,0)+nvl(A.VEHICLE_FLOW_26,0)," +
                    "A.VEHICLE_FEE_1=nvl(B.VEHICLE_FEE_1,0)+nvl(A.VEHICLE_FEE_1,0)," +
                    "A.VEHICLE_FEE_2=nvl(B.VEHICLE_FEE_2,0)+nvl(A.VEHICLE_FEE_2,0)," +
                    "A.VEHICLE_FEE_3=nvl(B.VEHICLE_FEE_3,0)+nvl(A.VEHICLE_FEE_3,0)," +
                    "A.VEHICLE_FEE_4=nvl(B.VEHICLE_FEE_4,0)+nvl(A.VEHICLE_FEE_4,0)," +
                    "A.VEHICLE_FEE_11=nvl(B.VEHICLE_FEE_11,0)+nvl(A.VEHICLE_FEE_11,0)," +
                    "A.VEHICLE_FEE_12=nvl(B.VEHICLE_FEE_12,0)+nvl(A.VEHICLE_FEE_12,0)," +
                    "A.VEHICLE_FEE_13=nvl(B.VEHICLE_FEE_13,0)+nvl(A.VEHICLE_FEE_13,0)," +
                    "A.VEHICLE_FEE_14=nvl(B.VEHICLE_FEE_14,0)+nvl(A.VEHICLE_FEE_14,0)," +
                    "A.VEHICLE_FEE_15=nvl(B.VEHICLE_FEE_15,0)+nvl(A.VEHICLE_FEE_15,0)," +
                    "A.VEHICLE_FEE_16=nvl(B.VEHICLE_FEE_16,0)+nvl(A.VEHICLE_FEE_16,0)," +
                    "A.VEHICLE_FEE_21=nvl(B.VEHICLE_FEE_21,0)+nvl(A.VEHICLE_FEE_21,0)," +
                    "A.VEHICLE_FEE_22=nvl(B.VEHICLE_FEE_22,0)+nvl(A.VEHICLE_FEE_22,0)," +
                    "A.VEHICLE_FEE_23=nvl(B.VEHICLE_FEE_23,0)+nvl(A.VEHICLE_FEE_23,0)," +
                    "A.VEHICLE_FEE_24=nvl(B.VEHICLE_FEE_24,0)+nvl(A.VEHICLE_FEE_24,0)," +
                    "A.VEHICLE_FEE_25=nvl(B.VEHICLE_FEE_25,0)+nvl(A.VEHICLE_FEE_25,0)," +
                    "A.VEHICLE_FEE_26=nvl(B.VEHICLE_FEE_26,0)+nvl(A.VEHICLE_FEE_26,0)," +
                    "A.UPDATE_TIME=sysdate " +
                    "WHEN NOT MATCHED THEN " +
                    "INSERT (A.STATION_ID,A.TRADE_DATE,A.ROAD_ID," +
                    "  A.VEHICLE_FLOW_1,A.VEHICLE_FLOW_2,A.VEHICLE_FLOW_3,A.VEHICLE_FLOW_4,A.VEHICLE_FLOW_11,A.VEHICLE_FLOW_12," +
                    "  A.VEHICLE_FLOW_13,A.VEHICLE_FLOW_14,A.VEHICLE_FLOW_15,A.VEHICLE_FLOW_16,A.VEHICLE_FLOW_21,A.VEHICLE_FLOW_22," +
                    "  A.VEHICLE_FLOW_23,A.VEHICLE_FLOW_24,A.VEHICLE_FLOW_25,A.VEHICLE_FLOW_26," +
                    "  A.VEHICLE_FEE_1,A.VEHICLE_FEE_2,A.VEHICLE_FEE_3,A.VEHICLE_FEE_4,A.VEHICLE_FEE_11,A.VEHICLE_FEE_12," +
                    "  A.VEHICLE_FEE_13,A.VEHICLE_FEE_14,A.VEHICLE_FEE_15,A.VEHICLE_FEE_16,A.VEHICLE_FEE_21,A.VEHICLE_FEE_22," +
                    "  A.VEHICLE_FEE_23,A.VEHICLE_FEE_24,A.VEHICLE_FEE_25,A.VEHICLE_FEE_26," +
                    "A.INSERT_TIME,A.UPDATE_TIME) " +
                    "VALUES(B.STATION_ID,B.TRADE_DATE,B.ROAD_ID,B.VEHICLE_FLOW_1,B.VEHICLE_FLOW_2,B.VEHICLE_FLOW_3,B.VEHICLE_FLOW_4," +
                    "B.VEHICLE_FLOW_11,B.VEHICLE_FLOW_12,B.VEHICLE_FLOW_13,B.VEHICLE_FLOW_14,B.VEHICLE_FLOW_15,B.VEHICLE_FLOW_16," +
                    "B.VEHICLE_FLOW_21,B.VEHICLE_FLOW_22,B.VEHICLE_FLOW_23,B.VEHICLE_FLOW_24,B.VEHICLE_FLOW_25,B.VEHICLE_FLOW_26," +
                    "B.VEHICLE_FEE_1,B.VEHICLE_FEE_2,B.VEHICLE_FEE_3,B.VEHICLE_FEE_4," +
                    "B.VEHICLE_FEE_11,B.VEHICLE_FEE_12,B.VEHICLE_FEE_13,B.VEHICLE_FEE_14,B.VEHICLE_FEE_15,B.VEHICLE_FEE_16," +
                    "B.VEHICLE_FEE_21,B.VEHICLE_FEE_22,B.VEHICLE_FEE_23,B.VEHICLE_FEE_24,B.VEHICLE_FEE_25,B.VEHICLE_FEE_26," +
                    "sysdate,null)";
            count = DBUtils.execute(connPre, statSql);
            XxlJobLogger.log("[出口流水统计]统计完成");

            XxlJobLogger.log("=====开始执行删除入口流水临时表操作===");
            String delSql = "delete from TB_SYNC_TRC_OTU_TMP where 1=1";
            count = DBUtils.execute(connPre, delSql);
        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }
    }

    /**
     * 统计ETC车流量及通行费信息
     * @param connPre
     * @throws Exception
     */
    private void statisEtcExCarFlowAndFee(Connection connPre) throws Exception{
        int count = 0;
        try{
            XxlJobLogger.log("[出口流水统计]统计开始");
            //合并临时完整性表到正式表
            String statSql = "MERGE INTO TB_STATIS_STATION_EXTRADE A USING V_SYNC_TRC_EXETCPU B " +
                    "ON (A.TRADE_DATE=B.TRADE_DATE and A.STATION_ID=B.STATION_ID) " +
                    "WHEN MATCHED THEN " +
                    "UPDATE SET A.VEHICLE_FLOW_1=nvl(B.VEHICLE_FLOW_1,0)+nvl(A.VEHICLE_FLOW_1,0)," +
                    "A.VEHICLE_FLOW_2=nvl(B.VEHICLE_FLOW_2,0)+nvl(A.VEHICLE_FLOW_2,0)," +
                    "A.VEHICLE_FLOW_3=nvl(B.VEHICLE_FLOW_3,0)+nvl(A.VEHICLE_FLOW_3,0)," +
                    "A.VEHICLE_FLOW_4=nvl(B.VEHICLE_FLOW_4,0)+nvl(A.VEHICLE_FLOW_4,0)," +
                    "A.VEHICLE_FLOW_11=nvl(B.VEHICLE_FLOW_11,0)+nvl(A.VEHICLE_FLOW_11,0)," +
                    "A.VEHICLE_FLOW_12=nvl(B.VEHICLE_FLOW_12,0)+nvl(A.VEHICLE_FLOW_12,0)," +
                    "A.VEHICLE_FLOW_13=nvl(B.VEHICLE_FLOW_13,0)+nvl(A.VEHICLE_FLOW_13,0)," +
                    "A.VEHICLE_FLOW_14=nvl(B.VEHICLE_FLOW_14,0)+nvl(A.VEHICLE_FLOW_14,0)," +
                    "A.VEHICLE_FLOW_15=nvl(B.VEHICLE_FLOW_15,0)+nvl(A.VEHICLE_FLOW_15,0)," +
                    "A.VEHICLE_FLOW_16=nvl(B.VEHICLE_FLOW_16,0)+nvl(A.VEHICLE_FLOW_16,0)," +
                    "A.VEHICLE_FLOW_21=nvl(B.VEHICLE_FLOW_21,0)+nvl(A.VEHICLE_FLOW_21,0)," +
                    "A.VEHICLE_FLOW_22=nvl(B.VEHICLE_FLOW_22,0)+nvl(A.VEHICLE_FLOW_22,0)," +
                    "A.VEHICLE_FLOW_23=nvl(B.VEHICLE_FLOW_23,0)+nvl(A.VEHICLE_FLOW_23,0)," +
                    "A.VEHICLE_FLOW_24=nvl(B.VEHICLE_FLOW_24,0)+nvl(A.VEHICLE_FLOW_24,0)," +
                    "A.VEHICLE_FLOW_25=nvl(B.VEHICLE_FLOW_25,0)+nvl(A.VEHICLE_FLOW_25,0)," +
                    "A.VEHICLE_FLOW_26=nvl(B.VEHICLE_FLOW_26,0)+nvl(A.VEHICLE_FLOW_26,0)," +
                    "A.VEHICLE_FEE_1=nvl(B.VEHICLE_FEE_1,0)+nvl(A.VEHICLE_FEE_1,0)," +
                    "A.VEHICLE_FEE_2=nvl(B.VEHICLE_FEE_2,0)+nvl(A.VEHICLE_FEE_2,0)," +
                    "A.VEHICLE_FEE_3=nvl(B.VEHICLE_FEE_3,0)+nvl(A.VEHICLE_FEE_3,0)," +
                    "A.VEHICLE_FEE_4=nvl(B.VEHICLE_FEE_4,0)+nvl(A.VEHICLE_FEE_4,0)," +
                    "A.VEHICLE_FEE_11=nvl(B.VEHICLE_FEE_11,0)+nvl(A.VEHICLE_FEE_11,0)," +
                    "A.VEHICLE_FEE_12=nvl(B.VEHICLE_FEE_12,0)+nvl(A.VEHICLE_FEE_12,0)," +
                    "A.VEHICLE_FEE_13=nvl(B.VEHICLE_FEE_13,0)+nvl(A.VEHICLE_FEE_13,0)," +
                    "A.VEHICLE_FEE_14=nvl(B.VEHICLE_FEE_14,0)+nvl(A.VEHICLE_FEE_14,0)," +
                    "A.VEHICLE_FEE_15=nvl(B.VEHICLE_FEE_15,0)+nvl(A.VEHICLE_FEE_15,0)," +
                    "A.VEHICLE_FEE_16=nvl(B.VEHICLE_FEE_16,0)+nvl(A.VEHICLE_FEE_16,0)," +
                    "A.VEHICLE_FEE_21=nvl(B.VEHICLE_FEE_21,0)+nvl(A.VEHICLE_FEE_21,0)," +
                    "A.VEHICLE_FEE_22=nvl(B.VEHICLE_FEE_22,0)+nvl(A.VEHICLE_FEE_22,0)," +
                    "A.VEHICLE_FEE_23=nvl(B.VEHICLE_FEE_23,0)+nvl(A.VEHICLE_FEE_23,0)," +
                    "A.VEHICLE_FEE_24=nvl(B.VEHICLE_FEE_24,0)+nvl(A.VEHICLE_FEE_24,0)," +
                    "A.VEHICLE_FEE_25=nvl(B.VEHICLE_FEE_25,0)+nvl(A.VEHICLE_FEE_25,0)," +
                    "A.VEHICLE_FEE_26=nvl(B.VEHICLE_FEE_26,0)+nvl(A.VEHICLE_FEE_26,0)," +
                    "A.UPDATE_TIME=sysdate " +
                    "WHEN NOT MATCHED THEN " +
                    "INSERT (A.STATION_ID,A.TRADE_DATE,A.ROAD_ID," +
                    "  A.VEHICLE_FLOW_1,A.VEHICLE_FLOW_2,A.VEHICLE_FLOW_3,A.VEHICLE_FLOW_4,A.VEHICLE_FLOW_11,A.VEHICLE_FLOW_12," +
                    "  A.VEHICLE_FLOW_13,A.VEHICLE_FLOW_14,A.VEHICLE_FLOW_15,A.VEHICLE_FLOW_16,A.VEHICLE_FLOW_21,A.VEHICLE_FLOW_22," +
                    "  A.VEHICLE_FLOW_23,A.VEHICLE_FLOW_24,A.VEHICLE_FLOW_25,A.VEHICLE_FLOW_26," +
                    "  A.VEHICLE_FEE_1,A.VEHICLE_FEE_2,A.VEHICLE_FEE_3,A.VEHICLE_FEE_4,A.VEHICLE_FEE_11,A.VEHICLE_FEE_12," +
                    "  A.VEHICLE_FEE_13,A.VEHICLE_FEE_14,A.VEHICLE_FEE_15,A.VEHICLE_FEE_16,A.VEHICLE_FEE_21,A.VEHICLE_FEE_22," +
                    "  A.VEHICLE_FEE_23,A.VEHICLE_FEE_24,A.VEHICLE_FEE_25,A.VEHICLE_FEE_26," +
                    "A.INSERT_TIME,A.UPDATE_TIME) " +
                    "VALUES(B.STATION_ID,B.TRADE_DATE,B.ROAD_ID,B.VEHICLE_FLOW_1,B.VEHICLE_FLOW_2,B.VEHICLE_FLOW_3,B.VEHICLE_FLOW_4," +
                    "B.VEHICLE_FLOW_11,B.VEHICLE_FLOW_12,B.VEHICLE_FLOW_13,B.VEHICLE_FLOW_14,B.VEHICLE_FLOW_15,B.VEHICLE_FLOW_16," +
                    "B.VEHICLE_FLOW_21,B.VEHICLE_FLOW_22,B.VEHICLE_FLOW_23,B.VEHICLE_FLOW_24,B.VEHICLE_FLOW_25,B.VEHICLE_FLOW_26," +
                    "B.VEHICLE_FEE_1,B.VEHICLE_FEE_2,B.VEHICLE_FEE_3,B.VEHICLE_FEE_4," +
                    "B.VEHICLE_FEE_11,B.VEHICLE_FEE_12,B.VEHICLE_FEE_13,B.VEHICLE_FEE_14,B.VEHICLE_FEE_15,B.VEHICLE_FEE_16," +
                    "B.VEHICLE_FEE_21,B.VEHICLE_FEE_22,B.VEHICLE_FEE_23,B.VEHICLE_FEE_24,B.VEHICLE_FEE_25,B.VEHICLE_FEE_26," +
                    "sysdate,null)";
            count = DBUtils.execute(connPre, statSql);
            XxlJobLogger.log("[出口流水统计]统计完成");

            XxlJobLogger.log("=====开始执行删除出口ETC流水临时表操作===");
            String delSql = "delete from TB_SYNC_TRC_EXETCPU_TMP where 1=1";
            count = DBUtils.execute(connPre, delSql);
        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }
    }

    /**
     * 统计出口刷卡车流量及通行费信息
     * @param connPre
     * @throws Exception
     */
    private void statisEtcExtuCarFlowAndFee(Connection connPre) throws Exception{
        int count = 0;
        try{
            XxlJobLogger.log("[出口流水统计]统计开始");
            //合并临时完整性表到正式表
            String statSql = "MERGE INTO TB_STATIS_STATION_EXTRADE A USING V_SYNC_TRC_ETCEXTU B " +
                    "ON (A.TRADE_DATE=B.TRADE_DATE and A.STATION_ID=B.STATION_ID) " +
                    "WHEN MATCHED THEN " +
                    "UPDATE SET A.VEHICLE_FLOW_1=nvl(B.VEHICLE_FLOW_1,0)+nvl(A.VEHICLE_FLOW_1,0)," +
                    "A.VEHICLE_FLOW_2=nvl(B.VEHICLE_FLOW_2,0)+nvl(A.VEHICLE_FLOW_2,0)," +
                    "A.VEHICLE_FLOW_3=nvl(B.VEHICLE_FLOW_3,0)+nvl(A.VEHICLE_FLOW_3,0)," +
                    "A.VEHICLE_FLOW_4=nvl(B.VEHICLE_FLOW_4,0)+nvl(A.VEHICLE_FLOW_4,0)," +
                    "A.VEHICLE_FLOW_11=nvl(B.VEHICLE_FLOW_11,0)+nvl(A.VEHICLE_FLOW_11,0)," +
                    "A.VEHICLE_FLOW_12=nvl(B.VEHICLE_FLOW_12,0)+nvl(A.VEHICLE_FLOW_12,0)," +
                    "A.VEHICLE_FLOW_13=nvl(B.VEHICLE_FLOW_13,0)+nvl(A.VEHICLE_FLOW_13,0)," +
                    "A.VEHICLE_FLOW_14=nvl(B.VEHICLE_FLOW_14,0)+nvl(A.VEHICLE_FLOW_14,0)," +
                    "A.VEHICLE_FLOW_15=nvl(B.VEHICLE_FLOW_15,0)+nvl(A.VEHICLE_FLOW_15,0)," +
                    "A.VEHICLE_FLOW_16=nvl(B.VEHICLE_FLOW_16,0)+nvl(A.VEHICLE_FLOW_16,0)," +
                    "A.VEHICLE_FLOW_21=nvl(B.VEHICLE_FLOW_21,0)+nvl(A.VEHICLE_FLOW_21,0)," +
                    "A.VEHICLE_FLOW_22=nvl(B.VEHICLE_FLOW_22,0)+nvl(A.VEHICLE_FLOW_22,0)," +
                    "A.VEHICLE_FLOW_23=nvl(B.VEHICLE_FLOW_23,0)+nvl(A.VEHICLE_FLOW_23,0)," +
                    "A.VEHICLE_FLOW_24=nvl(B.VEHICLE_FLOW_24,0)+nvl(A.VEHICLE_FLOW_24,0)," +
                    "A.VEHICLE_FLOW_25=nvl(B.VEHICLE_FLOW_25,0)+nvl(A.VEHICLE_FLOW_25,0)," +
                    "A.VEHICLE_FLOW_26=nvl(B.VEHICLE_FLOW_26,0)+nvl(A.VEHICLE_FLOW_26,0)," +
                    "A.VEHICLE_FEE_1=nvl(B.VEHICLE_FEE_1,0)+nvl(A.VEHICLE_FEE_1,0)," +
                    "A.VEHICLE_FEE_2=nvl(B.VEHICLE_FEE_2,0)+nvl(A.VEHICLE_FEE_2,0)," +
                    "A.VEHICLE_FEE_3=nvl(B.VEHICLE_FEE_3,0)+nvl(A.VEHICLE_FEE_3,0)," +
                    "A.VEHICLE_FEE_4=nvl(B.VEHICLE_FEE_4,0)+nvl(A.VEHICLE_FEE_4,0)," +
                    "A.VEHICLE_FEE_11=nvl(B.VEHICLE_FEE_11,0)+nvl(A.VEHICLE_FEE_11,0)," +
                    "A.VEHICLE_FEE_12=nvl(B.VEHICLE_FEE_12,0)+nvl(A.VEHICLE_FEE_12,0)," +
                    "A.VEHICLE_FEE_13=nvl(B.VEHICLE_FEE_13,0)+nvl(A.VEHICLE_FEE_13,0)," +
                    "A.VEHICLE_FEE_14=nvl(B.VEHICLE_FEE_14,0)+nvl(A.VEHICLE_FEE_14,0)," +
                    "A.VEHICLE_FEE_15=nvl(B.VEHICLE_FEE_15,0)+nvl(A.VEHICLE_FEE_15,0)," +
                    "A.VEHICLE_FEE_16=nvl(B.VEHICLE_FEE_16,0)+nvl(A.VEHICLE_FEE_16,0)," +
                    "A.VEHICLE_FEE_21=nvl(B.VEHICLE_FEE_21,0)+nvl(A.VEHICLE_FEE_21,0)," +
                    "A.VEHICLE_FEE_22=nvl(B.VEHICLE_FEE_22,0)+nvl(A.VEHICLE_FEE_22,0)," +
                    "A.VEHICLE_FEE_23=nvl(B.VEHICLE_FEE_23,0)+nvl(A.VEHICLE_FEE_23,0)," +
                    "A.VEHICLE_FEE_24=nvl(B.VEHICLE_FEE_24,0)+nvl(A.VEHICLE_FEE_24,0)," +
                    "A.VEHICLE_FEE_25=nvl(B.VEHICLE_FEE_25,0)+nvl(A.VEHICLE_FEE_25,0)," +
                    "A.VEHICLE_FEE_26=nvl(B.VEHICLE_FEE_26,0)+nvl(A.VEHICLE_FEE_26,0)," +
                    "A.UPDATE_TIME=sysdate " +
                    "WHEN NOT MATCHED THEN " +
                    "INSERT (A.STATION_ID,A.TRADE_DATE,A.ROAD_ID," +
                    "  A.VEHICLE_FLOW_1,A.VEHICLE_FLOW_2,A.VEHICLE_FLOW_3,A.VEHICLE_FLOW_4,A.VEHICLE_FLOW_11,A.VEHICLE_FLOW_12," +
                    "  A.VEHICLE_FLOW_13,A.VEHICLE_FLOW_14,A.VEHICLE_FLOW_15,A.VEHICLE_FLOW_16,A.VEHICLE_FLOW_21,A.VEHICLE_FLOW_22," +
                    "  A.VEHICLE_FLOW_23,A.VEHICLE_FLOW_24,A.VEHICLE_FLOW_25,A.VEHICLE_FLOW_26," +
                    "  A.VEHICLE_FEE_1,A.VEHICLE_FEE_2,A.VEHICLE_FEE_3,A.VEHICLE_FEE_4,A.VEHICLE_FEE_11,A.VEHICLE_FEE_12," +
                    "  A.VEHICLE_FEE_13,A.VEHICLE_FEE_14,A.VEHICLE_FEE_15,A.VEHICLE_FEE_16,A.VEHICLE_FEE_21,A.VEHICLE_FEE_22," +
                    "  A.VEHICLE_FEE_23,A.VEHICLE_FEE_24,A.VEHICLE_FEE_25,A.VEHICLE_FEE_26," +
                    "A.INSERT_TIME,A.UPDATE_TIME) " +
                    "VALUES(B.STATION_ID,B.TRADE_DATE,B.ROAD_ID,B.VEHICLE_FLOW_1,B.VEHICLE_FLOW_2,B.VEHICLE_FLOW_3,B.VEHICLE_FLOW_4," +
                    "B.VEHICLE_FLOW_11,B.VEHICLE_FLOW_12,B.VEHICLE_FLOW_13,B.VEHICLE_FLOW_14,B.VEHICLE_FLOW_15,B.VEHICLE_FLOW_16," +
                    "B.VEHICLE_FLOW_21,B.VEHICLE_FLOW_22,B.VEHICLE_FLOW_23,B.VEHICLE_FLOW_24,B.VEHICLE_FLOW_25,B.VEHICLE_FLOW_26," +
                    "B.VEHICLE_FEE_1,B.VEHICLE_FEE_2,B.VEHICLE_FEE_3,B.VEHICLE_FEE_4," +
                    "B.VEHICLE_FEE_11,B.VEHICLE_FEE_12,B.VEHICLE_FEE_13,B.VEHICLE_FEE_14,B.VEHICLE_FEE_15,B.VEHICLE_FEE_16," +
                    "B.VEHICLE_FEE_21,B.VEHICLE_FEE_22,B.VEHICLE_FEE_23,B.VEHICLE_FEE_24,B.VEHICLE_FEE_25,B.VEHICLE_FEE_26," +
                    "sysdate,null)";
            count = DBUtils.execute(connPre, statSql);
            XxlJobLogger.log("[出口流水统计]统计完成");

            XxlJobLogger.log("=====开始执行删除出口ETC刷卡流水临时表操作===");
            String delSql = "delete from TB_SYNC_TRC_ETCEXTU_TMP where 1=1";
            count = DBUtils.execute(connPre, delSql);
        }catch (Exception e){
            e.printStackTrace();
            throw e;
        }
    }

}
